/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.i.kotionokyurievna.jewelry.domain.order;

import java.util.Date;
import java.util.List;
import ua.i.kotionokyurievna.jewelry.domain.client.Client;
import ua.i.kotionokyurievna.jewelry.domain.employee.Employee;
import ua.i.kotionokyurievna.jewelry.domain.orderitem.OrderItem;

/**
 *
 * @author Kateryna_Reznik
 */
public class Order {
    private int orderId;
    private Date orderDate;
    private Client client;
    private Employee employee;
    private List<OrderItem> orderList;
    private OrderStatus orderStatus;
    private double discount;
    private double price;

    public Order() {
    }

    public Order(Date orderDate, Client client, Employee employee, 
            List<OrderItem> orderList, OrderStatus orderStatus) {
        this.orderDate = orderDate;
        this.client = client;
        this.employee = employee;
        this.orderList = orderList;
        this.orderStatus = orderStatus;
    }

    public Order(int orderId, Date orderDate, Client client, Employee employee, List<OrderItem> orderList, OrderStatus orderStatus) {
        this.orderId = orderId;
        this.orderDate = orderDate;
        this.client = client;
        this.employee = employee;
        this.orderList = orderList;
        this.orderStatus = orderStatus;
    }

    public int getOrderId() {
        return orderId;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    public OrderStatus getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(OrderStatus orderStatus) {
        this.orderStatus = orderStatus;
    }

    public List<OrderItem> getOrderList() {
        return orderList;
    }

    public void setOrderList(List<OrderItem> orderList) {
        this.orderList = orderList;
    }
    
    @Override
    public String toString() {
        return "Order{" + "orderId=" + orderId + ", orderDate=" + orderDate + 
                ", client=" + client + ", employee=" + employee + 
                ", orderStatus=" + orderStatus + '}';
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 97 * hash + (this.orderDate != null ? this.orderDate.hashCode() : 0);
        hash = 97 * hash + (this.client != null ? this.client.hashCode() : 0);
        hash = 97 * hash + (this.employee != null ? this.employee.hashCode() : 0);
        hash = 97 * hash + (this.orderList != null ? this.orderList.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Order other = (Order) obj;
        if (this.orderDate != other.orderDate && (this.orderDate == null || 
                !this.orderDate.equals(other.orderDate))) {
            return false;
        }
        if (this.client != other.client && (this.client == null || 
                !this.client.equals(other.client))) {
            return false;
        }
        if (this.employee != other.employee && (this.employee == null || 
                !this.employee.equals(other.employee))) {
            return false;
        }
        if (this.orderList != other.orderList && (this.orderList == null || 
                !this.orderList.equals(other.orderList))) {
            return false;
        }
        return true;
    }
    
    
    
}
